﻿/* 
 * OpenAfsControl.cs
 * 
 * Author - Ankit Gupta and Gaurav Aggarwal
 * 
 * Initialize and adds tabs to the main form.
 * 
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Microsoft.ManagementConsole.Project
{
    // Sets control properties of the snap-in
    class openafsControl : UserControl, IFormViewControl
    {
        openafsFormView afsview = null;
        private TabControl tabControl = new TabControl();
        private TabPage generalTab = new General();
        private TabPage cifsTab = new CIFS();
        private TabPage performanceTab = new Performance();
        private TabPage cachemanagerTab = new CacheManager();
        private TabPage freelanceTab = new FreelanceClient();
        private TabPage serversTab = new Servers();
        private TabPage logonoptionsTab = new LogonOptions();
        private TabPage diagnosticsTab = new Diagnostics();
        
        public openafsControl()
        {
            InitializeComponent();
            Dock = DockStyle.Fill;
        }

        // Adds the tabs to the form
        private void InitializeComponent()
        {
            tabControl.Name = "tabControl";
            tabControl.Dock = DockStyle.Fill;
            Controls.Add(tabControl);

            tabControl.Controls.Add(generalTab);
            tabControl.Controls.Add(cifsTab);
            tabControl.Controls.Add(performanceTab);
            tabControl.Controls.Add(cachemanagerTab);
            tabControl.Controls.Add(freelanceTab);
            tabControl.Controls.Add(serversTab);
            tabControl.Controls.Add(logonoptionsTab);
            tabControl.Controls.Add(diagnosticsTab);
        }

        void IFormViewControl.Initialize(FormView parentafsview)
        {
            afsview = (openafsFormView)parentafsview;
        }
    }
}